 /*ie8兼容*/
require('es5-shim');
require('es5-shim/es5-sham');
require('console-polyfill');
require('core-js/fn/object/assign');


import React from 'react'
import reactDOM from 'react-dom'
import Echarts from 'echarts';
import {Router, Route, hashHistory, browserHistory, IndexRoute, IndexRedirect, Redirect} from 'react-router'
import './assets/css/landlord/layout.css';
import './assets/css/landlord/common.css';
import './assets/css/landlord/login.css';
import './assets/css/landlord/workbench.css';
import './assets/css/landlord/addSign.css';
import './assets/css/landlord/rentBefore.css';
import './assets/css/landlord/myStyle.css';
import 'antd/dist/antd.css';
import './assets/css/official/common.css';
import './assets/css/official/footer.css';
import './assets/css/official/header.css';
import './assets/css/official/index.css';
import './assets/css/rest.css';

import Utils from './utils/util'

import App from './app'
import IndexFrame from './index' // 资金端账户外框
import Index from './official/index/officialIndex' // 官网首页
import IndexContent from './official/index/index' // 官网内容
import forgetPwdRouter from './official/login/forgetPwdRouter' //忘记密码
import agreeMentRouter from './official/index/agreeMentRouter' //爱租派服务协议

// 官网
const officialRouter = {
    component: IndexFrame,
    indexRoute: {component: IndexContent},
    childRoutes: [
        require('./official/index/officialRouter')
    ]
};
// 二房东登录后路由
const homeRouter = {
    component: App,
    childRoutes: [
        require('./module/workbench/workBenchRouter'),
        require('./module/landlord/bulkImport/bulkImportRouter'),
        require('./module/landlord/houseResource/houseResRouter'),
        require('./module/landlord/houseDecoration/rentDecoRouter'),
        require('./module/landlord/rentManage/rentRoom/rentRoomRouter'),
        require('./module/landlord/rentManage/advanceOrder/advanceOrderRouter'),
        require('./module/landlord/rentManage/checkOutOrder/checkOutOrderRouter'),
        require('./module/landlord/batchCharg/batchCHargingRouter'),
        require('./module/landlord/rentManage/signUpOrder/signUpOrderRouter'),
        require('./module/landlord/rentBefore/rentBeforeRouter'),
        require('./module/statisticalCenter/tenantCount/tenantCountRouter'),
        require('./module/statisticalCenter/ownerCount/ownerCountRouter'),
        require('./module/statisticalCenter/roomCount/roomCountRouter'),
        require('./module/statisticalCenter/rentRecord/rentRecordRouter'),
        require('./module/financialManage/collect/capitalRouter'),
        require('./module/financialManage/renterBill/rentBillRouter'),
        require('./module/financialManage/payBill/payBillRouter'),
        require('./module/financialSupport/loanApplication/loanRouter'),
        require('./module/systemSet/accountSecurity/accountSecurityRouter'),
        require('./module/systemSet/accountInfo/accountInfoRouter'),
        require('./module/systemSet/accountRecharge/accountRechargeRouter'),  //账号充值
        require('./module/systemSet/accountCash/accountCashRouter'),      //账户提现
        require('./module/systemSet/myCount/myCountRouter'),                    //我的账户
        require('./module/systemSet/record/recordRouter'),                 //资金记录
        require('./module/landlord/rentManage/reservationOrder/reservationOrderRouter'),
        require('./module/landlord/rentManage/reservationOrder/reservationOrderRouter')
    ]
};

// 资金端账户路由
const funderRouter = {
    component: IndexFrame,
    childRoutes: [
        require('./funderModule/funderRouter')
        // require('./funderModule/resourceView/viewRouter'),
    ]
};

const rootRoute = {
    path: '/',
    component: 'div',
    // indexRoute: { component: FunderIndex },
    childRoutes: [
        officialRouter, //官网登录
        homeRouter, // 二房东账户路由
        funderRouter, // 资金端账户路由
        forgetPwdRouter,  //忘记密码路由
        agreeMentRouter  //爱租派服务协议路由
    ]
};

reactDOM.render(<Router history={hashHistory} routes={rootRoute}/>,
    document.getElementById('app'));








